/*
 * Created on March 7, 2007 
 * 
 * Copyright (c) Patrick Armstrong 2002-2007. All Rights Reserved 
 */
package org.dime.mine.game.actions;

import org.dime.mine.game.Board;

/**
 * Action // TODO Add type summary
 * 
 * @author Owner
 */
public abstract class Action implements Executable
{
    private final Board.Location location;

    public Action(Board.Location location)
    {
        this.location = location;
    }

    public Board.Location getLocation()
    {
        return location;
    }

    /*
     * (non-Javadoc)
     * 
     * @see java.lang.Object#equals(java.lang.Object)
     */
    @Override
    public boolean equals(Object obj)
    {
        if (obj instanceof Action)
        {
            Action act = (Action) obj;
            return getClass().equals(act.getClass())
                    && getLocation().equals(act.getLocation());
        }
        return false;
    }

    /*
     * (non-Javadoc)
     * 
     * @see java.lang.Object#hashCode()
     */
    @Override
    public int hashCode()
    {
        return getClass().hashCode() + getLocation().hashCode();
    }
}
